package com.py.framework.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.py.framework.core.common.Page;
import com.py.framework.dao.TestDao;
import com.py.framework.service.TestService;

@Service
public class TestServiceImpl implements TestService {
	
	@Autowired
	private TestDao testDao;
	
	@Override
	public String getTestInfo(String username) {
		String result = testDao.getTestInfo(username);
		if (StringUtils.isBlank(result)) {
			result = username;
		}
		return result;
	}

	@Override
	public List<Map<String, Object>> queryInfoForPage(String username, Page page) { 
		Map<String, Object> params = new HashMap<>();
		params.put("username", username);
		params.put("page",     page);
		return testDao.queryInfoForPage(params);
	}
}